// -*- coding: utf-8 -*- 
/**
 * Project: AlgorithmsLearn
 *
 * @author: yanking
 * Create time: 2022-03-12 12:14
 * IDE: IntelliJ IDEA
 * Introduction:
 */
package com.LeetCodeT.DynamicPlan;

import org.junit.jupiter.api.Test;

import java.util.Arrays;
import java.util.Comparator;

public class NumWays {
    public int numWays(int n, int[][] relation, int k) {
        int[][] f = new int[k + 1][n];
        f[0][0] = 1;
        for (int i = 1; i < k + 1; i++) {
            for (int[] re : relation) {
                int start = re[0], dest = re[1];
                f[i][dest] += f[i - 1][start];
            }
        }
        return f[k][n - 1];
    }


    @Test
    public void shout() {
        int[][] test = {{0, 2}, {2, 1}, {3, 4}, {2, 3}, {1, 4}, {2, 0}, {0, 4}};
        System.out.println(numWays(5, test, 3));
    }
}
